package com.ruoyi.system.service.lmpl;

import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.SystemMapper;
import com.ruoyi.system.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Systemservicelmpl implements SystemService {
    @Autowired
    private SystemMapper systemMapper;

    @Override
    public void update1(Basicsetting basicsetting) {
        systemMapper.update1(basicsetting);
    }

    @Override
    public void update2(Collectset collectset) {
          systemMapper.update2(collectset);
    }

    @Override
    public void update3(Deliverysetup deliverysetup) {
          systemMapper.update3(deliverysetup);
    }

    @Override
    public Basicsetting getSystem1() {
        return systemMapper.getSystem1();
    }

    @Override
    public Collectset getSystem2() {
        return systemMapper.getSystem2();
    }

    @Override
    public Deliverysetup getSystem3() {
        return systemMapper.getSystem3();
    }

    @Override
    public Smartcounter getSystem4() {
        return systemMapper.getSystem4();
    }

    @Override
    public void update4(Smartcounter smartcounter) {
      systemMapper.update4(smartcounter);
    }

    @Override
    public List<Dropdownkey> getSystem6() {
        List<Dropdownkey> system6 = systemMapper.getSystem6();
        for (Dropdownkey dropdownkey : system6) {
           dropdownkey.setDropdownvalues(systemMapper.change(dropdownkey.getId()));
        }
        return system6;
    }

    @Override
    public void tianjia(Dropdownkey dropdownkey) {
        systemMapper.tianjia(dropdownkey);
    }

    @Override
    public void xiugai(Dropdownkey dropdownkey) {
        String v="";
        List<Dropdownvalue> dropdownvalues = dropdownkey.getDropdownvalues();
        for (Dropdownvalue dropdownvalue : dropdownvalues) {
          v=v+dropdownvalue.getValue()+",";
        }
        dropdownkey.setValue(v);
        systemMapper.xiugai(dropdownkey);
    }

    @Override
    public void xiugai1(Dropdownvalue dropdownvalue) {
        systemMapper.xiugai1(dropdownvalue);
    }

    @Override
    public void tianjia1(Dropdownvalue dropdownvalue) {
        systemMapper.tianjia1(dropdownvalue);
    }

    @Override
    public Dropdownkey cha(Integer did) {
        return systemMapper.cha(did);
    }

    @Override
    public  List<Dropdownvalue> cha2(Integer did) {
        return systemMapper.cha2(did);
    }
}
